package com.school.graduation.mine.presenter;

import android.content.Context;

import com.school.graduation.bean.MineReleasedCallBack;
import com.school.graduation.mine.model.MineReleasedModel;
import com.school.graduation.mine.model.MineReleasedModelInterface;
import com.school.graduation.mine.view.MineReleasedInterface;

public class MineReleasedPresenter {
    private Context mContext;
    private MineReleasedInterface mReleasedInterface;
    private MineReleasedModelInterface mModelInterface;

    private MineReleasedRecyclerAdapter mRecyclerAdapter;

    public MineReleasedPresenter(Context context, MineReleasedInterface releasedInterface) {
        mContext = context;
        mReleasedInterface = releasedInterface;
        mModelInterface = new MineReleasedModel(context, this);
        mRecyclerAdapter = new MineReleasedRecyclerAdapter(context);
    }

    public void loadMineReleasedGoods(String id){
        mModelInterface.loadMineReleasedGoods(id);
    }

    public void loadMineReleasedGoodsSuccess(MineReleasedCallBack mineReleasedCallBack){
        mRecyclerAdapter.setGoodsList(mineReleasedCallBack.getGoods());
        mReleasedInterface.setAdapter(mRecyclerAdapter);
    }
}
